import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: '/home/discovery'
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/Home.vue'),
    meta: {
      isShow: true
    },
    children: [
      {
        path: '/home/attention',
        name: 'attention',
        component: () => import('../components/Attention.vue')
      },
      {
        path: '/home/discovery',
        name: 'discovery',
        component: () => import('../components/Discovery.vue')
      },
      {
        path: '/home/near',
        name: 'near',
        component: () => import('../components/Near.vue')
      }
    ]
  },
  {
    path: '/shopping',
    name: 'shopping',
    component: () => import('@/views/Shopping.vue'),
    meta: {
      isShow: true
    }
  },
  {
    path: '/message',
    name: 'message',
    component: () => import('@/views/Message.vue'),
    meta: {
      isShow: true
    }
  },
  {
    path: '/mine',
    name: 'mine',
    component: () => import('@/views/Mine.vue'),
    meta: {
      isShow: true
    }
  },
  {
    path: '/daily',
    name: 'daily',
    component: () => import('@/views/Daily.vue'),
    meta: {
      isShow:false
    }
  },
  {
    path: '/search',
    name: 'search',
    component: () => import('@/views/Search.vue'),
    meta: {
      isShow:false
    }
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
